import requests
from  lxml import etree

headers = {
    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
    'Referer': "https://movie.douban.com/"
}
url = 'https://movie.douban.com/'
response = requests.get(url,headers=headers)
text = response.text.encode('gbk', 'ignore').decode('gbk')

html = etree.HTML(text)
uls = html.xpath("//*[@id='screening']/div[2]/ul/li")
for ul in uls:
    # print(etree.tostring(ul,encoding='utf-8').decode('utf-8'))
    title = ul.xpath("@data-title")
    # print(title)

